package com.lxyk.utils;

import com.lxyk.domain.StuTest;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ClassName StuTestCreator
 * @Description TODO
 * @Author FJQ
 * @Date 2022/4/29 16:05
 * @Version 1.0
 **/
public class StuTestCreator {

    public static List<StuTest> createStuTest(List<Integer> ids, Map map){

          List<StuTest> stuTests = new ArrayList<>();
          String stage = map.get("stage").toString();
          Integer cid = (Integer) map.get("cid");
          Date testDate = (Date) map.get("testDate");
          for (Integer id : ids) {
              StuTest stuTest = new StuTest();
              //变量
              stuTest.setTestDate(testDate);
              stuTest.setStage(stage);
              stuTest.setSid(id);
              stuTest.setCid(cid);
              //常量
              stuTest.setResult(0);
              stuTest.setMakeUp(0);
              stuTest.setPass(1);
              stuTest.setPartake(1);
              stuTests.add(stuTest);
          }
          return stuTests;

    }
}
